package user.admin;
import user.userer.Administrator;
import user.userer.Ordinary;

import java.util.Scanner;
public class MainUser {
    public void login() {
        Scanner input = new Scanner(System.in);
        System.out.println("***********************");
        System.out.println("1.注册账号");
        System.out.println("2.登录账号");
        System.out.println("3.退出");
        System.out.println("***********************");
        System.out.println("请输入你的选择");
        int choice = input.nextInt();
        switch (choice) {
            case 1:
                System.out.println("您选择了注册，即将跳转到用户注册");
                Register re = new Register();
                re.register();
                login();
                break;
            case 2:
                System.out.println("您选择了登录，即将跳转到用户登录");
                loginMenu();
                break;
            case 3:
                System.out.println("系统即将退出.....");
                System.out.println("欢迎下次使用");
                break;
            default:
                System.out.println("输入错误请重新输入");
                login();
                break;
        }
    }
    public void loginMenu() {
        System.out.println("***********************");
        System.out.println("欢迎使用图书商城");
        System.out.println("1.登录");
        System.out.println("2.退出");
        System.out.println("***********************");
        System.out.println("请输入你的选择：");
        Scanner scanner = new Scanner(System.in);
        int next = scanner.nextInt();
        switch (next) {
            case 1:
                System.out.println("正在进入登录窗口");
                logon lo1 = new logon();
                lo1.logon();
                break;
            case 2:
                System.out.println("系统即将退出.....");
                System.out.println("欢迎下次使用");
                break;
            default:
                System.out.println("输入错误请重新输入");
                loginMenu();
                break;
        }
    }
}